@if ($showLabel && $showField)
    @if ($options['wrapper'] !== false)
        <div {!! $options['wrapperAttrs'] !!} >
    @endif
@endif

@if ($showLabel && $options['label'] !== false && $options['label_show'])
    {!! Form::customLabel($name, $options['label'], $options['label_attr']) !!}
@endif

@php
    $options['attr'] = array_merge($options['attr'], [
        'style' => "margin: 5px 5px",
    ]);
@endphp

@if ($showField)
    @include('vendor.laravel-form-builder.help_block')
    <!-- 样式调整 width: 1400px;  -->
    <div id="{!! $name !!}" style="background: rgba(190,190,190,0.50); padding: 10px; width: 1400px;">
        @if(empty($options['value']))
            <div style="position: relative; margin-top: 20px; padding-top: 4px">
                <span class="span-X"><a><i class="fa fa-close"></i></a></span>
                {!!  Form::input($type, $name."[]", $options['value'], $options['attr']) !!}
            </div>
        @else
            @foreach($options['value'] as $value)
                <div style="position: relative; margin-top: 20px; padding-top: 4px">
                    <span class="span-X"><a><i class="fa fa-close"></i></a></span>
                    {!!  Form::input('text', $name."[]", $value, $options['attr']) !!}
                </div>
            @endforeach
        @endif

        {!!  Form::input('button', 'increase_text_add', "添加", ['class' => "btn btn-primary btn-sm", 'style' => "margin: 20px 5px;", 'id' => "increase_text_add"]) !!}
    </div>

@endif

@include('vendor.laravel-form-builder.errors')

@if ($showLabel && $showField)
    @if ($options['wrapper'] !== false)
        </div>
    @endif
@endif

@push('scripts')
    <script>
        $('#increase_text_add').on('click', function () {
            node = "<div style=\"position: relative; margin-top: 20px; padding-top: 4px\">\n" +
                "\t<span class=\"span-X\"><a><i class=\"fa fa-close\"></i></a></span>\n" +
                "\t<input class=\"form-control\" style=\"margin: 5px 5px\" name=\"values[]\" type=\"text\" value=\"\">\n" +
                "</div>";
            node = $(node).attr('name', "{!! $name !!}" + "[]");
            $(this).before(node);
        });
        $(document).on('click', ".span-X", function () {
            $(this).parent().remove();
        });
    </script>
@endpush
@push('stylesheets')
    <style>
        .span-X {
            position: absolute;
            border-radius: 10px;
            top: 0px;
            right: -8px;
            padding: 3px;
            line-height: 0;
            background-color: rgba(190,190,190,0.50);
        }
    </style>
@endpush
